Public Class frmDVQL
    Private _selectedValue As String

    Public Property SelectedValue()
        Get
            Return _selectedValue
        End Get
        Set(ByVal value)
            _selectedValue = value
        End Set
    End Property

    Private Sub frmDVQL_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadTreeView()
        Me.DBiTraDM1.MyTreeView.SelectedNode = Me.DBiTraDM1.MyTreeView.Nodes(0)
    End Sub

    Public Sub LoadTreeView()
        Me.DBiTraDM1.ConnStr = myConnStr
        Me.DBiTraDM1.UserID = g_UserID
        Me.DBiTraDM1.Password = g_Password
        Me.DBiTraDM1.TableName = "DonVi"
        Me.DBiTraDM1.MaFieldName = "MaDonVi"
        Me.DBiTraDM1.TenFieldName = "TenDonVi"
        Me.DBiTraDM1.CuoiFieldName = "Cuoi"
        Me.DBiTraDM1.IDFieldName = "DonVi_ID"
        Me.DBiTraDM1.MnuChonText = ""
        Me.DBiTraDM1.KhoiDong(0)
    End Sub

    Private Sub btnChon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChon.Click
        Me.Close()
    End Sub

    Private Sub DBiTraDM1_OnSelect(ByVal TxtValue As System.String, ByVal MaValue As System.String) Handles DBiTraDM1.OnSelect
        SelectedValue = MaValue
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        SelectedValue = ""
        Me.Close()
    End Sub
End Class